<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <title id="title">gorgeous-doc</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" type="text/css"
          th:href="@{/layui/css/layui.css}" media="all">
    <link rel="stylesheet" th:href="@{/layui/nprogress/nprogress.css}">
    <link rel="stylesheet" type="text/css" th:href="@{/css/global.css}">
    <div th:include="common/common.html"></div>
</head>
<body>

<div class="layui-layout-body">
    <div class="layui-layout layui-layout-admin">
        <div class="layui-header">
            <div class="layui-logo">
                <span style="font-size: 22px;color: #fff">gorgeous-doc</span>
            </div>
        </div>
        <div class="layui-side layui-bg-black">
            <div class="layui-side-scroll">
                <ul class="layui-nav layui-nav-tree" lay-shrink="all" lay-filter="">
                    <li class="layui-nav-item layui-nav-itemed">
                        <a class="" href="javascript:">
                            <i class="layui-icon">&#xe62a;</i> 项目管理
                        </a>
                        <dl class="layui-nav-child">
                            <dd><a href="javascript:" path="jobGroup/jobGroup" tab-id="1-1">项目维护</a></dd>
                        </dl>
                    </li>
                    <li class="layui-nav-item layui-nav-itemed">
                        <a href="javascript:">
                            <i class="layui-icon">&#xe62c;</i> 环境管理
                        </a>
                        <dl class="layui-nav-child">
                            <dd><a href="javascript:" path="log/log" tab-id="2-1">git信息</a></dd>
                            <dd><a href="javascript:" path="log/log" tab-id="2-2">环境配置</a></dd>
                            <dd><a href="javascript:" path="log/log" tab-id="2-3">配置管理</a></dd>
                        </dl>
                    </li>
                    <li class="layui-nav-item layui-nav-itemed">
                        <a href="javascript:">
                            <i class="layui-icon">&#xe62c;</i> 公共文件
                        </a>
                        <dl class="layui-nav-child">
                            <dd><a href="javascript:" path="log/log" tab-id="3-1">上传类</a></dd>
                        </dl>
                    </li>
                </ul>
            </div>
        </div>
        <!-- 内容主体区域 -->
        <div class="layui-body">
            <div class="layui-tab layui-tab-brief" lay-filter="ok-tab">
                <ul class="layui-tab-title">
                    <li lay-id="1-1" class="layui-this">项目维护</li>
                    <li lay-id="2-1" class="">git信息</li>
                    <li lay-id="2-2" class="">环境配置</li>
                    <li lay-id="2-3" class="">配置管理</li>
                    <li lay-id="3-1" class="">上传类</li>
                </ul>
                <div class="layui-tab-content">
                    <div class="layui-tab-item layui-show" tab-id="1-1">
                        <!--工具栏-->
                        <div class="toolbar">
                            <button class="layui-btn layui-btn-normal layui-btn-sm" onclick="saveProjectSuperBtn()">
                                添加
                            </button>
                            <button class="layui-btn layui-btn-normal layui-btn-sm" onclick="cloneProjectBtn()">
                                克隆/下载
                            </button>
                            <button class="layui-btn layui-btn-sm" onclick="dataTable.reload({});">
                                <i class="layui-icon layui-icon-refresh"></i>
                            </button>
                        </div>
                        <!--数据表格-->
                        <table class="" id="project-table" lay-filter="project-table-filter"></table>
                    </div>
                    <div class="layui-tab-item " tab-id="2-1">
                        <div th:include="git/gitTemplate.html"></div>
                    </div>
                    <div class="layui-tab-item " tab-id="2-2">
                        <div class="toolbar">
                            <button class="layui-btn layui-btn-sm" onclick="dataTableEnv.reload({});">
                                <i class="layui-icon layui-icon-refresh"></i>
                            </button>
                            <button class="layui-btn layui-btn-normal layui-btn-sm" onclick="openEnvForm()">
                                添加
                            </button>
                        </div>
                        <!--数据表格-->
                        <table class="" id="env-table" lay-filter="env-table-filter"></table>
                    </div>
                    <div class="layui-tab-item " tab-id="2-3">
                        <!--模糊搜索区域-->
                        <div class="layui-row">
                            <div class="layui-form">
                                <div class="layui-inline">
                                    <select id="searchType" class="input-sm">
                                        <option value=""></option>
                                        <option value="classTag">classTag</option>
                                        <option value="methodTag">methodTag</option>
                                        <option value="methodParamTag">methodParamTag</option>
                                        <option value="methodReturnTag">methodReturnTag</option>
                                        <option value="fieldTag">fieldTag</option>
                                        <option value="classAnnotation">classAnnotation</option>
                                        <option value="methodAnnotation">methodAnnotation</option>
                                        <option value="fieldAnnotation">fieldAnnotation</option>
                                        <option value="baseDataType">baseDataType</option>
                                        <option value="arrayType">arrayType</option>
                                    </select>
                                </div>
                                <button class="layui-btn layui-btn-sm">
                                    <i class="layui-icon layui-icon-search"
                                       onclick="configDataTable.reload({where:{type: $('#searchType').val()}});"></i>
                                </button>
                                <button class="layui-btn layui-btn-normal layui-btn-sm" onclick="saveConfigBtn()">
                                    添加
                                </button>
                            </div>
                        </div>
                        <!--数据表格-->
                        <table class="" id="config-table" lay-filter="config-table-filter"></table>
                    </div>
                    <!--上传类-->
                    <div class="layui-tab-item " tab-id="3-1">
                        <div class="layui-col-sm8">
                            <div id="beanForm" class="layui-form" action="">
                                <input type="hidden" name="id">
                                <div class="layui-form-item">
                                    <label class="layui-form-label">文件</label>
                                    <div class="layui-input-block">
                                        <input class="layui-input " api-parammode="0" api-type="file"
                                               placeholder="java文件多个"
                                               name="bean" type="file" multiple="multiple" style="padding: 5px;">
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label class="layui-form-label">包地址</label>
                                    <div class="layui-input-block">
                                        <input class="layui-input param-value" placeholder="com/lan/api  别写.啊"
                                               api-parammode="0" api-type="text" name="path" type="text">
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <div class="layui-input-block">
                                        <button class="layui-btn" onclick="uploadBean()">保存</button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
<div th:include="project/projectAddTemplate.html"></div>
<div th:include="project/projectCloneTemplate.html"></div>
<div th:include="project/projectEditTemplate.html"></div>
<div th:include="env/envAddTemplate.html"></div>
<div th:include="env/configAddTemplate.html"></div>
<script type="text/javascript">
    layui.use(modes, function () {
        let load = function () {
            $projectForm.addClass("layui-hide");
            $envForm.addClass("layui-hide");
            $configForm.addClass("layui-hide");
            //tab 切换
            let currMenuId = localStorage.getItem("CurrMenuId_manage");
            if (currMenuId) {
                element.tabChange("ok-tab", currMenuId);
            }
            $(".layui-nav-child").find("dd").click(function () {
                let tabId = $(this).children('a').attr('tab-id');
                // 切换选项卡
                element.tabChange("ok-tab", tabId);
                localStorage.setItem("CurrMenuId_manage", tabId);
            });
            $(".layui-tab-title li").click(function () {
                let tabId = $(this).attr('lay-id');
                localStorage.setItem("CurrMenuId_manage", tabId);
            });
            //项目数据表格
            renderProjectTable();
            saveProject(function () {
                layer.closeAll();
                dataTable.reload({});
                $projectForm.addClass("layui-hide");
            });
            //加载git信息 保存
            getGitInfo();
            //环境表格
            renderEnvTable();
            saveEnv(function () {
                layer.closeAll();
                dataTableEnv.reload({});
                $envForm.hide();
            });
            //配置
            renderConfigTable();
            saveConfigForm(function () {
                layer.closeAll();
                configDataTable.reload({type: $('[lay-filter="typeFilter"]').val()});
                $configForm.addClass("layui-hide");
            })
        };
        loadScript(['js/config', 'js/project/project', 'js/project/projectSuper', 'js/git/git', 'js/env/env', 'js/env/notesConfig'], load);
    });

</script>
<script type="text/html" id="project-toolbar">
    <a class="layui-btn layui-btn-xs" lay-event="addBranch">添加分支</a>
    <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
    <a class="layui-btn layui-btn-xs" lay-event="delete">删除</a>
</script>
<script type="text/html" id="env-toolbar">
    <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
    <a class="layui-btn layui-btn-xs" lay-event="delete">删除</a>
</script>
<script type="text/html" id="config-toolbar">
    <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
    <a class="layui-btn layui-btn-xs" lay-event="delete">删除</a>
</script>
</html>

